﻿package tools;

public class Test {
	public static void main(String[] args) {
//		String a = "At stake was an $80,000 settlement involving who should pay what share of cleanup costs at the site of a former gas station, where underground fuel tanks had leaked and contaminated the soil.";
		String a = "aren't asked of companies'em he's he've we're can't 9:30 he said: 1. Use credit  11.3   to improve the operation of capital markets,     not to provide subsidies. ";
		a = a.replaceAll("([;%`!\"\\(\\)\\?]|,$|[^ ]*\\$)", " $1 ").replaceAll("(n't|'re|'ve|'s)", " $1 ").replaceAll("([^\\d]):([^\\d]|$)", "$1 : $2");
		System.out.println(a);
		a = a.replaceAll(",([^\\d])", " ,$1").replaceAll("(\\d+)\\. ", "$1 . ").replaceAll("\\. \\. \\.", " ... ");
		System.out.println(a);
		a = a.replaceAll("\\s+", " ");
		System.out.println(a);
	}
}
